home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 4 / Eagles_Nest_Mac_Collection_Disc_4.TOAST / Database Management / 4DTransfData / FilePack 1.1 Docs < prev    next >
Text File  |  1990-11-18  |  23KB  |  715 lines

  1.  
  2. FilePack External Package for 4D 
  3. CIS v1.1 Release -- 11/18/90
  4.  
  5. Introduction
  6.  
  7. The FilePack external package for 4D is simply a collection of File-Manager and related routines that NDG has used in one form or another for various contracts.  When we purchased the 4D Externals Kit and discovered the new “package” format for bundling related functions & procedures into a single resource, it seemed like a great idea.  I used the folder of source files for these file routines to test my understanding of the concepts out, and FilePack was born. 
  8.  
  9.  
  10. These are quick and dirty routines, thrown into the public domain for all to use free of charge in any way they see fit, but with the usual disclaimers:  the software is offered “as is” for you to use at your own risk, with no expectation of support, bug-fixes or upgrades from me or NDG.  We’ve not run the package thru any formal, documented testing procedure - they are tested as they are needed.  This means _I_ am confident that they work, but you might not be.
  11.  
  12.  
  13. While I am not making any promises or interested in hearing any complaints, I am always eager to hear suggestions, constructive criticism and bug reports. These routines are all written to work with both 2.0.11 and 2.1 (you will notice that many of the string parameters are typed as "TEXT" - this is why). I have NOT yet tested them with v2.1.1, but I have no reason to believe there will be any problems.  Most are functions - I avoid passing values back from an external thru parameters because of the data-typing changes in v2.1 and because I hate having to create 4D globals just to call an external. As far as I can tell, you can directly pass any alpha, text or fixed-string expressions as parms to these routines.
  14.  
  15. Changes in v1.1:
  16.  
  17. 1.  GetFileName now accepts a "prompt" parameter, making it compatible with the other SFGet/Put routines, and requiring any code written with the old version to be rewritten (sorry!).  You can rename the external using 4D External Mover or ResEdit, and then write a 4D global to handle the parm defaults, like this:
  18.  
  19.           `GetFileName - Request a file selection
  20.           `I renamed the external GetFileName as NewGetFile
  21.         If(Count parameters=2)
  22.           $0:=NewGetFile($1;$2)
  23.         Else
  24.           $0:=NewGetFile("";$1) `Compatible with the old version
  25.         End if
  26.  
  27. 2.  Added two new SFGet-style routines: GetFoldername allows you to request a folder selection by the user, and GetVolumeName requests a volume.  These routines use modified calls to the standard-file package, so they are (should be?) compatible with Boomerang, etc.
  28.  
  29. 3.  Added a new routine to allow you to load the directory of any folder into an array.  With the addition of this routine, you can recreate DiskTools in 4D if you wanted to (IF you really wanted to...).
  30.  
  31. 4.  Renamed the GetVolName routine as GetDriveVolName, to clarify its function and the distinction with the new GetVolumeName routine.
  32.  
  33. 5.  Rewrote the GetVolSpace routine to accept the volume name instead of the drive number.  If you depend on its functioning the way it did in v1.0, you can rename it using 4D External Mover or ResEdit, and then recreate it in 4D using code such as this:
  34.  
  35.           `GetVolSpace - Determine the free space on a volume
  36.           `in a specific drive-no $1
  37.           `I renamed the external GetVolSpace as NewGetVolSpace
  38.         $volName:=GetDriveVolName($1)
  39.         If ($volName#"")
  40.           NewGetVolSpace($volName)
  41.         End if
  42.  
  43. 6.  Dropped the EjectDrive routine (which ejected a disk in the specified drive-number), in favor of the new EjectVolume routine (which ejects a named volume).  If you depend on EjectDrive, you can recreate it in 4D using code such as this:
  44.  
  45.           `EjectDrive - Eject the disk in a specific drive-no $1
  46.         $volName:=GetDriveVolName($1)
  47.         If ($volName#"")
  48.           EjectVolume($volName)
  49.         End if
  50.  
  51. ---------------------------------------------------------------------
  52. The Package Routines:
  53.  
  54.  
  55. GetFileName(prompt:T;types:T):S
  56.  
  57. Description:
  58.  
  59.     Allows you to display the standard file package's "Open File" (SFGetFile) dialog, to allow the user of your application to select an existing file, optionally limiting the selectable files to those of specific types.
  60.  
  61.     The first difference between this command and the native 4D command Open document is that this command does NOT open a channel to the selected file, in the event that you simply need the filename and do not wish to read/write to it immediately, need to perform any sort of validation or other processing, or wish to use the filename with any of the following FilePack routines that operate on existing files.
  62.  
  63.     The other difference is that this command allows you to provide a prompt to your users right on the standard file dialog.
  64.  
  65. Parameters:
  66.  
  67.     PromptString: String to be displayed immediately below the list of files and folders in the standard file dialog.
  68.  
  69.     FileTypes:  a string expression listing from 1 to 4 4-byte Macintosh file-type codes.  Only files with one of the file type codes specified will be visible in the file dialog (and therefore selectable by the user).  If a null string is passed, then all file types will be visible in the dialog.
  70.  
  71. Returns:
  72.  
  73.     The fully-qualified name of the file selected by the user.  If the user presses the dialog's Cancel button, returns a null string.
  74.  
  75. Examples:
  76.  
  77.     vFileName := GetFilename("Select any file…";"")
  78.     vFileName := GetFilename("Select a text file…";"TEXT")
  79.     vFileName := GetFilename("Select a text or MacPaint file…";"TEXTMPNT")
  80.  
  81.  
  82.  
  83. PutFileName(prompt:T;defaultName:T):S
  84.  
  85. Description:
  86.  
  87.     Allows you to display the standard file package's "Save File" (SFPutFile) dialog, to allow the user of your application to specify the name and folder for a new file, optionally allowing you to provide a prompt string and a suggested/default name for the new file.
  88.  
  89.     The difference between this command and the native 4D command Create document is that this command does NOT create the new file and open a channel to it, in the event that you simply need the filename and do not wish to read/write to it immediately, need to perform any sort of validation or other processing, or wish to use the filename with any of the following FilePack routines that operate on new files.
  90.  
  91. Parameters:
  92.  
  93.     PromptString: String to be displayed immediately above the text-edit field for the new file name in the standard file dialog.
  94.  
  95.     DefaultName: String to be placed in the text-edit area for the new file-name, to act as a default or recommended name for the new file (the user will be able to replace this name with whatever legal name they prefer.
  96.  
  97. Returns:
  98.  
  99.     The fully-qualified name of the file created by the user.  If the user presses the dialog's Cancel button, will return a null string.
  100.  
  101. Example:
  102.  
  103.     vNewFile := PutFileName("Save as:";"4D Export File")
  104.  
  105.  
  106.  
  107. GetFileCreator(fileName:T):S
  108.  
  109. Description:
  110.  
  111.     This function enables you to determine the creator code of an existing file.
  112.  
  113. Parameters:
  114.  
  115.     FileName: a string expression containing the fully-qualified file name.
  116.  
  117. Returns:
  118.  
  119.     The 4-byte creator code for the file.
  120.  
  121. Example:
  122.  
  123.     vFileName := GetFilename("Select the Excel export";"TEXT")
  124.     If (GetFileCreator(vFileName) # "XCEL")
  125.        ALERT("I thought this was supposed to be an Excel document?")
  126.     Else
  127.        ...
  128.     End if
  129.  
  130.  
  131.  
  132. GetFileType(fileName:T):S
  133.  
  134. Description:
  135.  
  136.     This function enables you to determine the file-type code of an existing file.
  137.  
  138. Parameters:
  139.  
  140.     FileName: a string expression containing the fully-qualified file name.
  141.  
  142. Returns:
  143.  
  144.     The 4-byte type code for the file.
  145.  
  146. Example:
  147.  
  148.     vFileName := GetFilename("Select a text or MacPaint file…";"TEXTMPNT")
  149.     Case of
  150.      :(vFileName="")
  151.         `User cancelled …skip it
  152.      :(GetFileType(vFileName)="TEXT")
  153.         `User selected a TEXT file …
  154.        …
  155.      :(GetFileType(vFileName)="MPNT")
  156.         `User selected a MacPaint file …
  157.        …
  158.     End case
  159.  
  160.  
  161.  
  162. SetFileInfo(fileName:T;typeCode:T;creatorCode:T):I
  163.  
  164. Description:
  165.  
  166.     This function enables you to assign a new file-type and/or creator code for an existing file.
  167.  
  168. Parameters:
  169.  
  170.     FileName: a string expression containing the fully-qualified file name.
  171.  
  172.     TypeCode: a four-byte string containing the file-type code to be assigned to the file.
  173.  
  174.     CreatorCode: a four-byte string containing the file-creator code to be assigned to the file.
  175.  
  176. Returns:
  177.  
  178.     An error code indicating whether the file codes were assigned successfully. A non-zero result indicates that there was an error.  See the File Manager chapter of Inside Mac for a listing and description of the possible errors.
  179.  
  180. Example:
  181.  
  182.     vFileName := PutFilename("Export the worksheet info to…";"Today’s Export")
  183.     SetFileInfo(vFileName;"TEXT";"XCEL") `User can doubleclick right into Excel
  184.  
  185.  
  186.  
  187. GetFileCDate(fileName:T):D
  188.  
  189. Description:
  190.  
  191.     This function enables you to determine the creation date of an existing file.
  192.  
  193. Parameters:
  194.  
  195.     FileName: a string expression containing the fully-qualified file name.
  196.  
  197. Returns:
  198.  
  199.     The date recorded by the Finder that the file was created.
  200.  
  201. Example:
  202.  
  203.     vFileName := GetFilename("Select the Excel export";"TEXT")
  204.     If (GetFileCDate(vFileName) # Current date)
  205.        ALERT("I need to see today’s worksheet!")
  206.     Else
  207.        ...
  208.     End if
  209.  
  210.  
  211.  
  212. GetFileCTime(fileName:T):L
  213.  
  214. Description:
  215.  
  216.     This function enables you to determine the time of day that an existing file was created.
  217.  
  218. Parameters:
  219.  
  220.     FileName: a string expression containing the fully-qualified file name.
  221.  
  222. Returns:
  223.  
  224.     The time of day recorded by the Finder that the file was created.  The time is returned as a LongInt representing the number of seconds since midnight.
  225.  
  226. Example:
  227.  
  228.     vFileName := GetFilename("Select the Excel export";"TEXT")
  229.     Case of
  230.      :(GetFileCDate(vFileName)#Current date)
  231.        ALERT("I need to see today’s worksheet!")
  232.      :(GetFileCTime(vFileName)>43200))
  233.        ALERT("I need to see this morning’s worksheet!")
  234.      Else
  235.        ...
  236.     End case
  237.  
  238.  
  239.  
  240. GetFileMDate(fileName:T):D
  241.  
  242. Description:
  243.  
  244.     This function enables you to determine the date an existing file was most recently modified.
  245.  
  246. Parameters:
  247.  
  248.     FileName: a string expression containing the fully-qualified file name.
  249.  
  250. Returns:
  251.  
  252.     The date recorded by the Finder that the file was modified last.
  253.  
  254.  
  255.  
  256. GetFileMTime(fileName:T):L
  257.  
  258. Description:
  259.  
  260.     This function enables you to determine the time of day that an existing file was last modifed.
  261.  
  262. Parameters:
  263.  
  264.     FileName: a string expression containing the fully-qualified file name.
  265.  
  266. Returns:
  267.  
  268.     The time of day recorded by the Finder that the file was last modified.  The time is returned as a LongInt representing the number of seconds since midnight.
  269.  
  270.  
  271.  
  272. GetFileLogSize(fileName:T):L
  273.  
  274. Description:
  275.  
  276.     This function returns the logical size of an existing file; i.e. the number of bytes that could actually be imported from the file.
  277.  
  278. Parameters:
  279.  
  280.     FileName: a string expression containing the fully-qualified file name.
  281.  
  282. Returns:
  283.  
  284.     The number of bytes of data in the file.
  285.  
  286. Example:
  287.  
  288.     vFileName := GetFilename("Import which file?";"TEXT")
  289.     Case of
  290.      :(GetFileLogSize(vFileName)=0)
  291.        ALERT("This file is empty!")
  292.      :(GetFileLogSize(vFileName)>30000)
  293.        ALERT("This file is too big to store in a single field!")
  294.      Else
  295.        RECEIVE PACKET(…)
  296.     End case
  297.  
  298.  
  299.  
  300. GetFilePhySize(fileName:T):L
  301.  
  302. Description:
  303.  
  304.     This function determines the physical size of an existing file; i.e. the number of bytes of space it occupies on disk.
  305.  
  306. Parameters:
  307.  
  308.     FileName: a string expression containing the fully-qualified file name.
  309.  
  310. Returns:
  311.  
  312.     The number of bytes of space occupied by the file on disk.
  313.  
  314.  
  315.  
  316. CopyFile(oldFileName:T;newFileName:T):I
  317.  
  318. Description:
  319.  
  320.     This function allows you to make a copy of any existing file to any other folder on the same disk or any other mounted disk.
  321.  
  322. Parameters:
  323.  
  324.     OldFileName: a string expression containing the fully-qualified name of the file to be copied.
  325.  
  326.     NewFileName: a string expression containing the fully-qualified name of the copy of the file to be created.  The complete pathname for the copy of the file to be created specifies which disk will hold the copy, the folder to put it in, and what its name should be.  Therefore, this path must refer to a non-existent file in an existing directory; i.e. the volume name and folders specified must already exist, but the filename must not.
  327.  
  328. Returns:
  329.  
  330.     An error code indicating whether or not the file copy was created successfully. A non-zero result indicates that there was an error.  See the File Manager chapter of Inside Mac for a listing and description of the possible errors.
  331.  
  332. Example:
  333.  
  334.     $result:=CopyFile("Server1:Export";"Server2:Export Backup")
  335.     If($result#0)
  336.       ALERT("There was a problem making the backup copy: "+String($result))
  337.     End if
  338.  
  339.  
  340.  
  341. NewFolder(pathSpec:T):I
  342.  
  343. Description:
  344.  
  345.     Given a pathname of a non-existing folder whose parent path does exist (such as will be returned by PutFileName), creates the folder in the subdirectory of its parent.
  346.  
  347. Parameters:
  348.  
  349.     NewFolderPath: the pathname of the new folder.  The pathname must specify a new name in an existing directory.
  350.  
  351. Returns:
  352.  
  353.     Zero if the folder was created successfully; if an error occurs, the OS error code will be returned.  Usually, such errors will be caused by the specification of a name for a folder/file that already exists, or of a folder in a non-existent parent directory.
  354.  
  355. Example:
  356.  
  357.     $folderName:=PutFileName("Create a Quick-Reports Folder…";"Reports")
  358.     if($folderName#"")
  359.       $result:=NewFolder($folderName)
  360.       If($result#0)
  361.         ALERT("There was a problem creating the new folder: "+String($result))
  362.       End if
  363.     End if
  364.  
  365.  
  366.  
  367. GetFolderName(prompt:T):S
  368.  
  369. Description:
  370.  
  371.     Presents a modified SFGetFile dialog, allowing the user to select an existing folder, and returns the fully-qualified pathname for the selected folder.  The dialog has an additional button called Select that will be enabled whenever a folder is highlighted in the file list area.  The Select button allows the user to close the dialog and return the fully-qualified pathname of the highlighted folder to your procedure.
  372.  
  373. Parameters:
  374.  
  375.     PromptString: String to be displayed immediately below the list of folders in the standard file dialog.
  376.  
  377. Returns:
  378.  
  379.     The fully-qualified name of the folder selected by the user.  The string will end with a semi-colon.  If the user presses the dialog's Cancel button, returns a null string.
  380.  
  381. Example:
  382.  
  383.     $folderName:=GetFolderName("Where are your Quick-Reports?")
  384.     if($folderName#"")
  385.       HFSCatToArray($folderName;asQRFiles)
  386.     End if
  387.  
  388.  
  389.  
  390. GetSystemPath:S
  391.  
  392. Description:
  393.  
  394.     Returns the path name for the current system folder.
  395.  
  396. Parameters:
  397.  
  398.     None
  399.  
  400. Returns:
  401.  
  402.     The fully-qualified name of the folder containing the startup System file, Finder, etc.  The string will end with a semi-colon.
  403.  
  404. Example:
  405.  
  406.     $systemPath:=GetSystemPath
  407.     $prefFile:=$systemPath+"database.prefs"
  408.  
  409.  
  410.  
  411. GetDatabasePath:S
  412.  
  413. Description:
  414.  
  415.     Returns the path specification for the current data file.
  416.  
  417.     Note: This function uses the 4D callback routine EX_Get_Infos, and in order for this routine to function properly, you must force 4D to update the STR resource in your structure file by "manually" selecting the database file at least once.
  418.  
  419. Parameters:
  420.  
  421.     None
  422.  
  423. Returns:
  424.  
  425.     The fully-qualified name of the current database file.
  426.  
  427. Example:
  428.  
  429.     $dataPath:=GetDatabasePath
  430.     $helpFile:=HFSGetParentName($dataPath)+"Help File"
  431.  
  432.  
  433.  
  434. GetStructurePath:S
  435.  
  436. Description:
  437.  
  438.     Returns the path specification for the 4D structure file.
  439.  
  440. Parameters:
  441.  
  442.     None
  443.  
  444. Returns:
  445.  
  446.     The fully-qualified name of the currently-running structure or compiled-application file.
  447.  
  448.  
  449.  
  450. HFSParentName(pathSpec:T):S
  451.  
  452. Description:
  453.  
  454.     This function returns the path name for the folder that a given file/folder is in; it simply strips away the file's simple name from its fully-qualified name.
  455.  
  456. Parameters:
  457.  
  458.     PathSpec: a string expression containing the fully-qualified file/folder name.
  459.  
  460. Returns:
  461.  
  462.     The path for the specified filename; i.e., all characters in the parameter value up to and including the last colon in the string.
  463.  
  464. Example:
  465.  
  466.     vFileName := "Server:Databases:Export text"
  467.     vShortName := HFSParentName(vFileName)
  468.       `At this point, vShortName is equal to "Server:Databases:"
  469.  
  470.  
  471.  
  472. HFSShortName(pathSpec:T):S
  473.  
  474. Description:
  475.  
  476.     This function returns the simple name for a given file/folder; it simply strips away the file's path name from its fully-qualified name.  This performs the complimentary function to the HFSParentName routine.
  477.  
  478. Parameters:
  479.  
  480.     PathSpec: a string expression containing the fully-qualified file/folder name.
  481.  
  482. Returns:
  483.  
  484.     The simple name for the specified file/folder; i.e., all characters in the parameter value following the last colon in the string.
  485.  
  486. Example:
  487.  
  488.     vFileName := "Server:Databases:Export text"
  489.     vShortName := HFSShortName(vFileName)
  490.       `At this point, vShortName is equal to "Export text"
  491.  
  492.  
  493.  
  494. HFSMove(oldPathSpec:T;newPathSpec:T):I
  495.  
  496. Description:
  497.  
  498.     Given a pathname of an existing file or folder in the first parm, and the pathname to any other folder on the same volume in the second parm, will move the existing file or folder to the subdirectory of the other folder.
  499.  
  500. Parameters:
  501.  
  502.     OldPathSpec: the pathname of an existing file or folder that you wish to move to a different location in the volume’s folder hierarchy.
  503.  
  504.     NewPathSpec: the pathname of the folder that is to contain the existing file/folder after the move. This folder must be on the same volume as the file/folder to be moved.
  505.  
  506. Returns:
  507.  
  508.     Zero if the move was completed successfully; if an error occurs, the OS error code will be returned. Refer to Inside Mac for a list and description of the possible error codes.  Usually, errors are caused by specification of paths that do not exist or are not on the same volume.
  509.  
  510. Example:
  511.  
  512.     $result:=HFSMove("Server:Database:Mktg Exports";"Server:Marketing")
  513.  
  514.  
  515.  
  516. HFSRename(pathSpec:T;newName:T):I
  517.  
  518. Description:
  519.  
  520.     Given the pathname for an existing file or folder, and a new simple name, renames the file or folder.
  521.  
  522. Parameters:
  523.  
  524.     PathSpec: the pathname of an existing file or folder that you wish to rename.
  525.  
  526.     NewName: a new simple name (do not respecify the entire path) for the file or folder.
  527.  
  528. Returns:
  529.  
  530.     Zero if the file/folder was renamed successfully; if an error occurs, the OS error code will be returned.  Usually, such errors will be caused by the specification of a non-existant file/folder for parm 1, or of an existing file name for parm 2.
  531.  
  532. Example:
  533.  
  534.     $result:=HFSRename("Server:Database:Today's Export";"Yesterday's Export")
  535.  
  536.  
  537.  
  538. HFSDelete(pathSpec:T):I
  539.  
  540. Description:
  541.  
  542.     Allows you to delete an existing file or folder (IF the folder is empty!).
  543.  
  544. Parameters:
  545.  
  546.     PathSpec: the pathname of an existing file or folder that you wish to delete.
  547.  
  548. Returns:
  549.  
  550.     Zero if the file/folder was deleted successfully; if an error occurs, the OS error code will be returned.  Usually, such errors will be caused by the specification of a non-existant file/folder, or of a folder that is not empty.
  551.  
  552. Example:
  553.  
  554.     $result:=HFSDelete("Server:Database:Really old file")
  555.  
  556.  
  557.  
  558. HFSExists(pathSpec:T):I
  559.  
  560. Description:
  561.  
  562.     This function enables you to easily test for the existence of a file or folder.
  563.  
  564. Parameters:
  565.  
  566.     PathSpec: a string expression containing the path to the file or folder to be tested.
  567.  
  568. Returns:
  569.  
  570.     A value of 1 if the entry exists; zero if it does not.
  571.  
  572. Example:
  573.  
  574.     If (HFSExists([Parms]HelpFileName))
  575.        vHelpFRef := Open document([Parms]HelpFileName)
  576.        ...
  577.     Else
  578.        ALERT("Sorry, but something has apparently happened to the help file.")
  579.     End if
  580.  
  581.  
  582.  
  583. HFSCatToArray(pathSpec:T;arrayName:T)
  584.  
  585. Description:
  586.  
  587.     Creates a text array containing a list of the simple names for all files and subdirectories contained in the specified folder.  Folder names will end with a colon, while file names will not.
  588.  
  589. Parameters:
  590.  
  591.     PathSpec: a string expression containing the path to the folder to be loaded.
  592.  
  593.     ArrayName: a string expression containing the name of the text array to be created/replaced to store the folder's directory.
  594.  
  595.     Note: if you are going to use this routine in a compiled database, you must be sure that you declare the array explicitly, using the ARRAY TEXT statement, somewhere in your application.
  596.  
  597. Returns:
  598.  
  599.     Nothing - this is a procedure, not a function.
  600.  
  601. Example:
  602.  
  603.     $folder:=GetFolderName("Folder to load?")
  604.     If($folder#"")
  605.       ARRAY TEXT(aCatList;0)  `Predeclare for the compiler
  606.       HFSCatToArray($folder;"aCatList")
  607.     End if
  608.  
  609.  
  610.  
  611. EjectVolume(volumeName:T):I
  612.  
  613. Description:
  614.  
  615.     Ejects the disk with the specified name.
  616.  
  617. Parameters:
  618.  
  619.     VolumeName: Name of the volume to eject.
  620.  
  621. Returns:
  622.  
  623.     Zero if the volume was successfully ejected; if an error occurred, a non-zero error code is returned. Usually such errors are caused by passing a name of a non-existant or non-ejectable volume.
  624.  
  625. Example:
  626.  
  627.     $result:=EjectVolume("Backup Disk 1")
  628.  
  629.  
  630.  
  631. GetVolumeName(prompt:T):S
  632.  
  633. Description:
  634.  
  635.     This function allows you to provide the user with a means of selecting a volume, and will return the selected volume's name. It displays a customized Standard-File dialog showing nothing but the Eject, Drive, Select and Cancel buttons, and a prompt that you supply.
  636.  
  637. Parameters:
  638.  
  639.     Prompt: A string expression that will display along the bottom of the dialog.
  640.  
  641. Returns:
  642.  
  643.     A string representing the name of the selected volume, or an empty string if the user cancels.
  644.  
  645. Example:
  646.  
  647.     $volName:=GetVolumeName("Select a disk…")
  648.  
  649.  
  650.  
  651. GetDriveVolName(driveNo:I):S
  652.  
  653. Description:
  654.  
  655.     Given a physical drive number (1-3 for floppies, >3 for hard disks, CD’s etc.), returns the volume name.  Use this routine for identifying volumes in specific drives, or for generating a list of available volumes.
  656.  
  657. Parameters:
  658.  
  659.     DriveNo: the drive number (potentially) containing a volume you wish to identify.
  660.  
  661. Returns:
  662.  
  663.     A string representing the name of the volume in the designated drive, or a null string if the drive is non-existant or empty.
  664.  
  665. Example:
  666.  
  667.     ARRAY STRING(32;aVolumes;7)
  668.     For($i;1;7)
  669.       aVolumes{$i}:=GetDriveVolName($i)
  670.     End for
  671.  
  672.  
  673.  
  674. GetVolSpace(volName:T):L
  675.  
  676. Description:
  677.  
  678.     Given a volume name, returns the number of free bytes available on the disk.
  679.  
  680. Parameters:
  681.  
  682.     VolName: a string representing the name of a mounted volume (such as that returned by GetVolumeName).
  683.  
  684. Returns:
  685.  
  686.     The number of free bytes on the volume specified.
  687.  
  688. Example:
  689.  
  690.     $diskSpace:=GetVolSpace("Server:")
  691.  
  692.  
  693.  
  694. IsVolLocked(volName:T):L
  695.  
  696. Description:
  697.  
  698.     Enables you to determine if a volume is write-protected, i.e. if the user has set the sliding tab on the corner of the disk to the write-protected position.
  699.  
  700.     NOTE: for some reason beyond me at the moment, this works fine with locked floppy-disks, but not with CD's... maybe soon I'll have time to figure out why (anybody out there have any suggestions?).
  701.  
  702. Parameters:
  703.  
  704.     VolName: a string representing the name of a mounted volume (such as that returned by GetVolumeName).
  705.  
  706. Returns:
  707.  
  708.     An integer value of zero if the disk is NOT locked, 1 if it is.
  709.  
  710. Example:
  711.  
  712.     If(IsVolLocked($diskName)=1)
  713.        ALERT("Sorry, you can't export to that disk - it's locked!")
  714.     End if
  715.